﻿using System;
using System.Buffers;

namespace Beefly.Json.Meta;

public interface IJsonFormat
{
}

public abstract class AJsonFormat<T> : IJsonFormat
{
    public abstract void Serialize(IBufferWriter<char> writer, ref T item);
    public abstract T Deserialize(in Span<char> str);
}

public abstract class AJsonArrayFormat1<T> : IJsonFormat
{
    public abstract void SerializeArray(IBufferWriter<char> writer, ref T[] item);
    public abstract T[] DeserializeArray(in Span<char> str);
}

public abstract class AJsonArrayFormat2<T> : IJsonFormat
{
    public abstract void SerializeArray(IBufferWriter<char> writer, ref T[,] item);
    public abstract T[,] DeserializeArray(in Span<char> str);
}

public abstract class AJsonArrayFormat3<T> : IJsonFormat
{
    public abstract void SerializeArray(IBufferWriter<char> writer, ref T[,,] item);
    public abstract T[,,] DeserializeArray(in Span<char> str);
}

public abstract class AJsonArrayFormat4<T> : IJsonFormat
{
    public abstract void SerializeArray(IBufferWriter<char> writer, ref T[,,,] item);
    public abstract T[,,,] DeserializeArray(in Span<char> str);
}

public abstract class AJsonArrayFormat5<T> : IJsonFormat
{
    public abstract  void SerializeArray(IBufferWriter<char> writer, ref T[,,,,] item);
    public abstract T[,,,,] DeserializeArray(in Span<char> str);
}